<template>
  <div>
    <h1 v-bgred>自定义指令</h1>
    <p v-bgred v-bold>show</p>
  </div>
</template>

<script>
export default {
  name: "App",
  directives:{
    bgred(ele){
      ele.style.background = "red"
    }
  }
};
</script>

<style></style>
